import QtQuick
import QtQuick.Controls

Page {
    id: root
    property int pageNum: 0
    property int pageType: 0

    enum Type{
        System,
        App,
        Account
    }

    header: ToolBar{
        Button{
            text: "返回"
            onClicked:{
                stackView.pop()
            }
        }

        Text{
            anchors.centerIn: parent
            text:
                if(pageType === CPage.System)
                    return "这是系统管理页面";
                else if(pageType === CPage.App)
                    return "这是应用管理页面";
                else if(pageType === CPage.Account)
                    return "这是账户页面";
        }
    }


    Column{
        anchors.centerIn: parent
        spacing: 20
        Text{
            text: "页面个数:" + pageNum
        }

        Row{
            Button{
                text: "系统管理"
                onClicked: stackView.push(Qt.createComponent("CPage.qml"),{pageNum:stackView.depth,pageType:CPage.System})
            }
            Button{
                text: "应用管理"
                onClicked: stackView.push(Qt.createComponent("CPage.qml"),{pageNum:stackView.depth,pageType:CPage.App})
            }
            Button{
                text: "账户"
                onClicked: stackView.push(Qt.createComponent("CPage.qml"),{pageNum:stackView.depth,pageType:CPage.Account})
            }
        }
    }

}
